﻿using Idte.Common.Imperfect;
using Idte.Core.Infrastructure.Repository;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Idte.HumanResource.Core
{
    public class Person<TParent> : Person
    {
        [ForeignKey("ParentId")]
        public TParent Parent { get; set; }
        public int ParentId { get; set; }
    }

    [Aggregate]
    public class Person
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid SysId { get; set; }

        [ForeignKey("PrimaryNameId")]
        public Name PrimaryName { get; set; }
        public Guid PrimaryNameId { get; set; }

        [DefaultValue(Gender.Unknown)]
        public Gender Gender { get; set; }
        [DefaultValue(MaritalStatus.Unstated)]
        public MaritalStatus MaritalStatus { get; set; }
        public DateTime? DateOfBirth { get; set; }
        public MissingDateTime MissingDoBParts { get; set; }
        [InverseProperty("Owner")]
        public ICollection<Name> Names { get; set; }
        public ICollection<Identification> IDs { get; set; }
    }
}
